import router from "./router";
// import { RouteRecordRaw } from "vue-router";
// import { formatRoutes } from "./utils/router";
import { useAuthStore } from "@/store";
// import { App } from "vue";

// 路由加载前
router.beforeEach(async (to, from, next) => {
    const { menus } = useAuthStore();
    const routerList = menus;
    routerList.forEach((route) => {
        router.addRoute(route); // 动态添加可访问路由表
    });
    next();
});

// 路由跳转之后调用
router.afterEach((to) => {});
